{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#对于标签，将特征处理成历史特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn.model_selection import train_test_split\n",
    "import xgboost as xgb\n",
    "\n",
    "window_size=3\n",
    "\n",
    "PATH_PROCESSED_DATA = 'processed/'\n",
    "FILENAME_TESTSET = PATH_PROCESSED_DATA+f'data_past{window_size}_test.csv'\n",
    "FILENAME_TRAIN_AND_VALID = PATH_PROCESSED_DATA+f'data_past{window_size}_train_and_valid.csv'\n",
    "PATH_TESTSET_PREDICTIONS = 'predict_tables/'\n",
    "\n",
    "data_test = pd.read_csv(FILENAME_TESTSET)\n",
    "data_train_and_valid = pd.read_csv(FILENAME_TRAIN_AND_VALID)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "#评价指标WMAPE\n",
    "def compute_sum_diff_and_sum_real_and_wmape(actuals,predictions):\n",
    "    actuals=list(actuals)\n",
    "    predictions=list(predictions)\n",
    "    len_predicitons = len(predictions)\n",
    "    sum_diff = 0.0\n",
    "    sum_real = sum([abs(i) for i in actuals])\n",
    "    \n",
    "    for i in range(len_predicitons):\n",
    "        pred = predictions[i]\n",
    "        real = actuals[i]\n",
    "        sum_diff += abs(pred - real)\n",
    "    #若分母为0，判断分子。若分子为0，输出0,；若分子不为0，输出100.\n",
    "    if sum_real==0:\n",
    "        if sum_diff==sum_real:\n",
    "            return sum_diff,sum_real,0\n",
    "        else:\n",
    "            return sum_diff,sum_real,100\n",
    "    else:\n",
    "        wmape =sum_diff/ sum_real\n",
    "        return sum_diff,sum_real,wmape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "cols_past= ['apply_amt', 'redeem_amt', 'net_in_amt', 'uv_fundown','uv_stableown','uv_fundopt','uv_fundmarket','uv_termmarket', 'total_net_value', 'yield']\n",
    "cols_past_combined=[f'{col}_{i}' for i in range(1,window_size+1) for col in cols_past]\n",
    "cols_now=['forecast_step','is_week_end','is_month_end','num_days_from_base']\n",
    "cols_x=cols_past_combined+cols_now\n",
    "\n",
    "cols_y=['apply_amt_pred', 'redeem_amt_pred', 'net_in_amt_pred']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Best parameters: eta=0.2, max_depth=10\n",
      "wmape on apply_amt_pred of train set: 0.16391238284548976\n",
      "wmape on apply_amt_pred of valid set: 0.22852920741198846\n",
      "Best parameters: eta=0.2, max_depth=10\n",
      "wmape on redeem_amt_pred of train set: 0.1962377038351098\n",
      "wmape on redeem_amt_pred of valid set: 0.3061548675137655\n",
      "Best parameters: eta=0.2, max_depth=10\n",
      "wmape on net_in_amt_pred of train set: 0.2911704130185894\n",
      "wmape on net_in_amt_pred of valid set: 0.395708035275792\n",
      "wmape on train set: 0.2911704130185894\n",
      "wmape on valid set: 0.395708035275792\n"
     ]
    }
   ],
   "source": [
    "#分别创建预测apply, redeem,net的model\n",
    "models= {}\n",
    "\n",
    "X_train_and_valid=data_train_and_valid[cols_x]\n",
    "len_train_set=X_train_and_valid.shape[0]\n",
    "\n",
    "#randomly split train and valid\n",
    "X_train, X_valid, y_train_3, y_valid_3 = train_test_split(X_train_and_valid, data_train_and_valid[cols_y], test_size=0.3,random_state=42,shuffle=True)\n",
    "\n",
    "sum_diff_train=0\n",
    "sum_real_train=0\n",
    "sum_diff_valid=0\n",
    "sum_real_valid=0\n",
    "\n",
    "for col_y in cols_y:\n",
    "    y_train=y_train_3[col_y]\n",
    "    y_valid=y_valid_3[col_y]\n",
    "\n",
    "    wmape_best = 100#初始值\n",
    "    ## eta指学习率\n",
    "    for eta in [0.1, 0.2,0.3]:\n",
    "        for max_depth in [5,10,20]:\n",
    "            model = xgb.XGBRegressor(eta=eta, max_depth=max_depth)\n",
    "            model.fit(X_train, y_train)\n",
    "            valid_preds = model.predict(X_valid)\n",
    "            _,_,wmape_valid = compute_sum_diff_and_sum_real_and_wmape(y_valid, valid_preds)\n",
    "            \n",
    "            if wmape_valid < wmape_best:\n",
    "                wmape_best = wmape_valid\n",
    "                eta_best = eta\n",
    "                max_depth_best = max_depth\n",
    "                sum_diff_valid,sum_real_valid,_= compute_sum_diff_and_sum_real_and_wmape(y_valid, valid_preds)\n",
    "\n",
    "    model = xgb.XGBRegressor(eta=eta_best, max_depth=max_depth_best)\n",
    "    model.fit(X_train, y_train)\n",
    "    train_preds=model.predict(X_train)\n",
    "    sum_diff_train,sum_real_train,wmape_train = compute_sum_diff_and_sum_real_and_wmape(y_train,train_preds)\n",
    "\n",
    "    print(f'Best parameters: eta={eta_best}, max_depth={max_depth_best}')\n",
    "    print(f'wmape on {col_y} of train set: {wmape_train}')\n",
    "    print(f'wmape on {col_y} of valid set: {wmape_best}')\n",
    "\n",
    "    sum_diff_valid+=sum_diff_valid\n",
    "    sum_real_valid+=sum_real_valid\n",
    "    sum_diff_train+=sum_diff_train\n",
    "    sum_real_train+=sum_real_train\n",
    "\n",
    "    models[col_y]=model\n",
    "\n",
    "\n",
    "\n",
    "wmape_train=sum_diff_train/sum_real_train\n",
    "wmape_valid=sum_diff_valid/sum_real_valid\n",
    "print(f'wmape on train set: {wmape_train}')\n",
    "print(f'wmape on valid set: {wmape_valid}')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "#分别创建预测apply, redeem,net的model\n",
    "\n",
    "X_test=data_test[cols_x]\n",
    "pred_apply = models['apply_amt_pred'].predict(X_test)\n",
    "pred_redeem = models['redeem_amt_pred'].predict(X_test)\n",
    "pred_net_in = models['net_in_amt_pred'].predict(X_test)\n",
    "\n",
    "# 将预测结果保存到data中对应的列中\n",
    "data_test.loc[:,\"apply_amt_pred\"] = pred_apply\n",
    "data_test.loc[:,\"redeem_amt_pred\"] = pred_redeem\n",
    "data_test.loc[:,\"net_in_amt_pred\"] = pred_net_in\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "#保存测试集的预测结果到本地\n",
    "way_steps=10\n",
    "way_past=3\n",
    "way_feature='combined'\n",
    "way_model='xgb'\n",
    "way_split='7to3'\n",
    "way_test='applyDirectRedeemDirectNetDirect'\n",
    "data_test.to_csv(PATH_TESTSET_PREDICTIONS+f\"predict_table_feature-{way_feature}_model-{way_model}_split-{way_split}_test-{way_test}_steps-{way_steps}_past-{way_past}.csv\",index=False,columns=['product_pid','transaction_date','apply_amt_pred','redeem_amt_pred','net_in_amt_pred'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>product_pid</th>\n",
       "      <th>forecast_step</th>\n",
       "      <th>transaction_date</th>\n",
       "      <th>is_week_end</th>\n",
       "      <th>is_month_end</th>\n",
       "      <th>num_days_from_base</th>\n",
       "      <th>apply_amt_1</th>\n",
       "      <th>apply_amt_2</th>\n",
       "      <th>apply_amt_3</th>\n",
       "      <th>redeem_amt_1</th>\n",
       "      <th>...</th>\n",
       "      <th>uv_termmarket_3</th>\n",
       "      <th>total_net_value_1</th>\n",
       "      <th>total_net_value_2</th>\n",
       "      <th>total_net_value_3</th>\n",
       "      <th>yield_1</th>\n",
       "      <th>yield_2</th>\n",
       "      <th>yield_3</th>\n",
       "      <th>apply_amt_pred</th>\n",
       "      <th>redeem_amt_pred</th>\n",
       "      <th>net_in_amt_pred</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>product1</td>\n",
       "      <td>1</td>\n",
       "      <td>20221110</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>675</td>\n",
       "      <td>5.341221</td>\n",
       "      <td>2.736650</td>\n",
       "      <td>2.006213</td>\n",
       "      <td>0.058544</td>\n",
       "      <td>...</td>\n",
       "      <td>58381603.0</td>\n",
       "      <td>8.535990</td>\n",
       "      <td>8.523480</td>\n",
       "      <td>8.519310</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>2.487401</td>\n",
       "      <td>0.330979</td>\n",
       "      <td>4.336968</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>product1</td>\n",
       "      <td>2</td>\n",
       "      <td>20221111</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>676</td>\n",
       "      <td>5.341221</td>\n",
       "      <td>2.736650</td>\n",
       "      <td>2.006213</td>\n",
       "      <td>0.058544</td>\n",
       "      <td>...</td>\n",
       "      <td>58381603.0</td>\n",
       "      <td>8.535990</td>\n",
       "      <td>8.523480</td>\n",
       "      <td>8.519310</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.194593</td>\n",
       "      <td>0.233023</td>\n",
       "      <td>1.189337</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>product1</td>\n",
       "      <td>3</td>\n",
       "      <td>20221114</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>679</td>\n",
       "      <td>5.341221</td>\n",
       "      <td>2.736650</td>\n",
       "      <td>2.006213</td>\n",
       "      <td>0.058544</td>\n",
       "      <td>...</td>\n",
       "      <td>58381603.0</td>\n",
       "      <td>8.535990</td>\n",
       "      <td>8.523480</td>\n",
       "      <td>8.519310</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>2.487401</td>\n",
       "      <td>0.329087</td>\n",
       "      <td>4.390482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>product1</td>\n",
       "      <td>4</td>\n",
       "      <td>20221115</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>680</td>\n",
       "      <td>5.341221</td>\n",
       "      <td>2.736650</td>\n",
       "      <td>2.006213</td>\n",
       "      <td>0.058544</td>\n",
       "      <td>...</td>\n",
       "      <td>58381603.0</td>\n",
       "      <td>8.535990</td>\n",
       "      <td>8.523480</td>\n",
       "      <td>8.519310</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>2.487401</td>\n",
       "      <td>0.336743</td>\n",
       "      <td>4.390482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>product1</td>\n",
       "      <td>5</td>\n",
       "      <td>20221116</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>681</td>\n",
       "      <td>5.341221</td>\n",
       "      <td>2.736650</td>\n",
       "      <td>2.006213</td>\n",
       "      <td>0.058544</td>\n",
       "      <td>...</td>\n",
       "      <td>58381603.0</td>\n",
       "      <td>8.535990</td>\n",
       "      <td>8.523480</td>\n",
       "      <td>8.519310</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>2.464383</td>\n",
       "      <td>0.355443</td>\n",
       "      <td>4.279323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1385</th>\n",
       "      <td>product99</td>\n",
       "      <td>6</td>\n",
       "      <td>20221117</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>682</td>\n",
       "      <td>1.967026</td>\n",
       "      <td>0.874283</td>\n",
       "      <td>1.040069</td>\n",
       "      <td>21.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>34932463.0</td>\n",
       "      <td>4.353897</td>\n",
       "      <td>4.352646</td>\n",
       "      <td>4.351812</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.675772</td>\n",
       "      <td>19.134428</td>\n",
       "      <td>-7.840563</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1386</th>\n",
       "      <td>product99</td>\n",
       "      <td>7</td>\n",
       "      <td>20221118</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>683</td>\n",
       "      <td>1.967026</td>\n",
       "      <td>0.874283</td>\n",
       "      <td>1.040069</td>\n",
       "      <td>21.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>34932463.0</td>\n",
       "      <td>4.353897</td>\n",
       "      <td>4.352646</td>\n",
       "      <td>4.351812</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.530912</td>\n",
       "      <td>0.859871</td>\n",
       "      <td>-5.055806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1387</th>\n",
       "      <td>product99</td>\n",
       "      <td>8</td>\n",
       "      <td>20221121</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>686</td>\n",
       "      <td>1.967026</td>\n",
       "      <td>0.874283</td>\n",
       "      <td>1.040069</td>\n",
       "      <td>21.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>34932463.0</td>\n",
       "      <td>4.353897</td>\n",
       "      <td>4.352646</td>\n",
       "      <td>4.351812</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.950993</td>\n",
       "      <td>23.087469</td>\n",
       "      <td>-9.379244</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1388</th>\n",
       "      <td>product99</td>\n",
       "      <td>9</td>\n",
       "      <td>20221122</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>687</td>\n",
       "      <td>1.967026</td>\n",
       "      <td>0.874283</td>\n",
       "      <td>1.040069</td>\n",
       "      <td>21.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>34932463.0</td>\n",
       "      <td>4.353897</td>\n",
       "      <td>4.352646</td>\n",
       "      <td>4.351812</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.746558</td>\n",
       "      <td>18.737885</td>\n",
       "      <td>-8.246806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1389</th>\n",
       "      <td>product99</td>\n",
       "      <td>10</td>\n",
       "      <td>20221123</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>688</td>\n",
       "      <td>1.967026</td>\n",
       "      <td>0.874283</td>\n",
       "      <td>1.040069</td>\n",
       "      <td>21.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>34932463.0</td>\n",
       "      <td>4.353897</td>\n",
       "      <td>4.352646</td>\n",
       "      <td>4.351812</td>\n",
       "      <td>0.02105</td>\n",
       "      <td>0.02155</td>\n",
       "      <td>0.0216</td>\n",
       "      <td>1.746558</td>\n",
       "      <td>17.518900</td>\n",
       "      <td>-8.223768</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1390 rows × 39 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     product_pid  forecast_step  transaction_date  is_week_end  is_month_end  \\\n",
       "0       product1              1          20221110            0             0   \n",
       "1       product1              2          20221111            1             0   \n",
       "2       product1              3          20221114            0             0   \n",
       "3       product1              4          20221115            0             0   \n",
       "4       product1              5          20221116            0             0   \n",
       "...          ...            ...               ...          ...           ...   \n",
       "1385   product99              6          20221117            0             0   \n",
       "1386   product99              7          20221118            1             0   \n",
       "1387   product99              8          20221121            0             0   \n",
       "1388   product99              9          20221122            0             0   \n",
       "1389   product99             10          20221123            0             0   \n",
       "\n",
       "      num_days_from_base  apply_amt_1  apply_amt_2  apply_amt_3  redeem_amt_1  \\\n",
       "0                    675     5.341221     2.736650     2.006213      0.058544   \n",
       "1                    676     5.341221     2.736650     2.006213      0.058544   \n",
       "2                    679     5.341221     2.736650     2.006213      0.058544   \n",
       "3                    680     5.341221     2.736650     2.006213      0.058544   \n",
       "4                    681     5.341221     2.736650     2.006213      0.058544   \n",
       "...                  ...          ...          ...          ...           ...   \n",
       "1385                 682     1.967026     0.874283     1.040069     21.100487   \n",
       "1386                 683     1.967026     0.874283     1.040069     21.100487   \n",
       "1387                 686     1.967026     0.874283     1.040069     21.100487   \n",
       "1388                 687     1.967026     0.874283     1.040069     21.100487   \n",
       "1389                 688     1.967026     0.874283     1.040069     21.100487   \n",
       "\n",
       "      ...  uv_termmarket_3  total_net_value_1  total_net_value_2  \\\n",
       "0     ...       58381603.0           8.535990           8.523480   \n",
       "1     ...       58381603.0           8.535990           8.523480   \n",
       "2     ...       58381603.0           8.535990           8.523480   \n",
       "3     ...       58381603.0           8.535990           8.523480   \n",
       "4     ...       58381603.0           8.535990           8.523480   \n",
       "...   ...              ...                ...                ...   \n",
       "1385  ...       34932463.0           4.353897           4.352646   \n",
       "1386  ...       34932463.0           4.353897           4.352646   \n",
       "1387  ...       34932463.0           4.353897           4.352646   \n",
       "1388  ...       34932463.0           4.353897           4.352646   \n",
       "1389  ...       34932463.0           4.353897           4.352646   \n",
       "\n",
       "      total_net_value_3  yield_1  yield_2  yield_3  apply_amt_pred  \\\n",
       "0              8.519310  0.02105  0.02155   0.0216        2.487401   \n",
       "1              8.519310  0.02105  0.02155   0.0216        1.194593   \n",
       "2              8.519310  0.02105  0.02155   0.0216        2.487401   \n",
       "3              8.519310  0.02105  0.02155   0.0216        2.487401   \n",
       "4              8.519310  0.02105  0.02155   0.0216        2.464383   \n",
       "...                 ...      ...      ...      ...             ...   \n",
       "1385           4.351812  0.02105  0.02155   0.0216        1.675772   \n",
       "1386           4.351812  0.02105  0.02155   0.0216        1.530912   \n",
       "1387           4.351812  0.02105  0.02155   0.0216        1.950993   \n",
       "1388           4.351812  0.02105  0.02155   0.0216        1.746558   \n",
       "1389           4.351812  0.02105  0.02155   0.0216        1.746558   \n",
       "\n",
       "      redeem_amt_pred  net_in_amt_pred  \n",
       "0            0.330979         4.336968  \n",
       "1            0.233023         1.189337  \n",
       "2            0.329087         4.390482  \n",
       "3            0.336743         4.390482  \n",
       "4            0.355443         4.279323  \n",
       "...               ...              ...  \n",
       "1385        19.134428        -7.840563  \n",
       "1386         0.859871        -5.055806  \n",
       "1387        23.087469        -9.379244  \n",
       "1388        18.737885        -8.246806  \n",
       "1389        17.518900        -8.223768  \n",
       "\n",
       "[1390 rows x 39 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_test"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "AFAC2023ApplyAndRedeem_env",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.17"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
